package com.gqz.defect.entity;

import com.alibaba.fastjson.annotation.JSONField;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.util.Date;
import java.util.HashMap;
import java.util.Map;


@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("T_EN_DEFECTS_SHEET_REL")
public class TEnDefectsSheetRelEntity implements Serializable {
/**todo todo必须要指定表的主键，指定完成后删除此行todo  */

    /**
     * 主键
     */
    @TableField(value = "ID")
    private String id;

    /**
     * 工单id
     */
    @TableField(value = "SHEET_ID")
    private String sheetId;

    /**
     * 缺陷隐患id
     */
    @TableField(value = "DEFECTS_ID")
    private String defectsId;

    /**
     * 是否删除 0否1是
     */
    @TableField(value = "SFSC")
    private String sfsc;

    /**
     * 创建时间
     */
    @TableField(value = "CREATE_TIME")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(name = "createTime", format = "yyyy-MM-dd HH:mm:ss")
    private Date createTime;

    /**
     * 缺陷隐患是否仍存在 (1.存在2.不存在)
     */
    @TableField(value = "IS_EXIT")
    private String isExit;

    /**
     * 消缺前照片
     */
    @TableField(value = "BEFORE_PICTURE_IDS")
    private String beforePictureIds;

    /**
     * 消缺中照片
     */
    @TableField(value = "IN_PICTURE_IDS")
    private String inPictureIds;

    /**
     * 消缺后照片
     */
    @TableField(value = "AFTER_PICTURE_IDS")
    private String afterPictureIds;

    /**
     * 处理方法
     */
    @TableField(value = "DEAL_METHOD")
    private String dealMethod;

    /**
     * 备注
     */
    @TableField(value = "REMARK")
    private String remark;

    /**
     * 处理结果
     */
    @TableField(value = "HANDLE_RESULT")
    private String handleResult;

    /**
     * 未处理原因
     */
    @TableField(value = "NO_HANDLE_REASON")
    private String noHandleReason;

    /**
     * 到达现场照片
     */
    @TableField(value = "DDXC_PICTURE_IDS")
    private String ddxcPictureIds;

    /**
     * 现场情况图片ids
     */
    @TableField(value = "XCQK_PICTURE_IDS")
    private String xcqkPictureIds;

    /**
     * 到达现场时间
     */
    @TableField(value = "DDXC_TIME")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(name = "ddxcTime", format = "yyyy-MM-dd HH:mm:ss")
    private Date ddxcTime;

    /**
     * 到达现场坐标
     */
    @TableField(value = "DDXC_ZB")
    private String ddxcZb;

    /**
     * 消缺时间
     */
    @TableField(value = "QXYH_XQSJ")
    @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JSONField(name = "qxyhXqsj", format = "yyyy-MM-dd HH:mm:ss")
    private Date qxyhXqsj;

    /**
     * start这个是必须要的动态条件集合start   start
     */
    private static Map<String, SFunction<TEnDefectsSheetRelEntity, ?>> map;

    static {
        map = new HashMap<>();
        map.put("id", TEnDefectsSheetRelEntity::getId);
        map.put("sheetId", TEnDefectsSheetRelEntity::getSheetId);
        map.put("defectsId", TEnDefectsSheetRelEntity::getDefectsId);
        map.put("sfsc", TEnDefectsSheetRelEntity::getSfsc);
        map.put("createTime", TEnDefectsSheetRelEntity::getCreateTime);
        map.put("isExit", TEnDefectsSheetRelEntity::getIsExit);
        map.put("beforePictureIds", TEnDefectsSheetRelEntity::getBeforePictureIds);
        map.put("inPictureIds", TEnDefectsSheetRelEntity::getInPictureIds);
        map.put("afterPictureIds", TEnDefectsSheetRelEntity::getAfterPictureIds);
        map.put("dealMethod", TEnDefectsSheetRelEntity::getDealMethod);
        map.put("remark", TEnDefectsSheetRelEntity::getRemark);
        map.put("handleResult", TEnDefectsSheetRelEntity::getHandleResult);
        map.put("noHandleReason", TEnDefectsSheetRelEntity::getNoHandleReason);
        map.put("ddxcPictureIds", TEnDefectsSheetRelEntity::getDdxcPictureIds);
        map.put("xcqkPictureIds", TEnDefectsSheetRelEntity::getXcqkPictureIds);
        map.put("ddxcTime", TEnDefectsSheetRelEntity::getDdxcTime);
        map.put("ddxcZb", TEnDefectsSheetRelEntity::getDdxcZb);
        map.put("qxyhXqsj", TEnDefectsSheetRelEntity::getQxyhXqsj);

    }

    public static SFunction<TEnDefectsSheetRelEntity, ?> genColumnSFunction(String column) {
        return map.get(column);
    }
    /** end这个是必须要的动态条件集合end   end */


}
